package code.rocky.chapter03;

// 建议33：不要覆写静态方法
public class Suggest33 {

    public static void main(String[] args) {
        Base base = new Sub();
        base.doAnything();
        base.doSomething();
    }

}

// 基类
class Base {
    public static void doSomething() {
        System.out.println("我是父类静态方法");
    }

    public void doAnything() {
        System.out.println("我是父类非静态方法");
    }
}

// 子类, 覆写父类方法
class Sub extends Base {

    public static void doSomething() {
        System.out.println("我是子类静态方法");
    }

    @Override
    public void doAnything() {
        System.out.println("我是子类非静态方法");
    }
}
